﻿using System.ComponentModel;

namespace Looptribe.Moodlin8.ViewModel
{
    public abstract class Wrapper<T> : INotifyPropertyChanged
    {
        private readonly T _wrappedObject;
        public T WrappedObject { get { return _wrappedObject; } }

        protected Wrapper(T wrappedObject)
        {
            _wrappedObject = wrappedObject;
        }

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
                handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
